<template>
	<view class="top">
		<view class="search-box">
			<view class="city">
				<text class="text">武汉</text>
				<u-icon class="icon" color="#BCBCBC " name="arrow-down-fill"></u-icon>
			</view>
			<input class="input" type="text" />
		</view>
		<view class="search-bottom">
			<view class="left">
				<text :class="searchType==0?'active':''" @click="switchType(0)">搜职位</text>
				<text :class="searchType==1?'active':''" @click="switchType(1)">搜公司</text>
			</view>
			<view class="right">
				<view class="tag active"> 区域位置 </view>
				<view class="tag"> 筛选 </view>
			</view>
		</view>
	</view>
	<view v-if="searchType==1" class="list company">
		<view class="company-item" v-for="item in 10">
			<view class="com-info">
				<image src="@/static/img/chat/pic-company.png" mode=""></image>
				<view class="info-right">
					<text class="one-line name">武汉地大信息工程股份有限公司武汉地大信息工程股份有限公司</text>
					<view class="one-line">
						<text>已上市</text> ·
						<text>150-500人 </text> ·
						<text>计算机软件计算机软件计算机软件</text>
					</view>
					<u-icon class="after" color="#E8E8E8" size="36" name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="job-info" v-show="showMore||(index<4)" v-for="(item,index) in 10">
				<view class="title">
					<text class="one-line">UI设计师设计师设计师设计师设计师设计师设计师设计师设计师设计师设计师</text>
					<text class="num">4-8K</text>
				</view>
				<view class="p">
					<view class="tag">武昌区水果湖</view>
					<view class="tag">3-5年</view>
					<view class="tag">大专</view>
				</view>
			</view>
			<button v-if="!showMore" class="look-more" @click="showMore=true">查看全部职位 <u-icon class="after"
					color="#676767" size="36" name="arrow-right"></u-icon></button>
		</view>
	</view>
	<view v-if="searchType==0" class="list job">
		<view class="job-item" v-for="item in 10">
			<view class="title">
				<text class="one-line">UI设计师设计师设计师设计师设计师设计师设计师设计师设计师设计师设计师</text>
				<text class="num">4-8K</text>
			</view>
			<view class="p">
				<view class="tag">武昌区水果湖</view>
				<view class="tag">3-5年</view>
				<view class="tag">大专</view>
			</view>
			<view class="fj-b">
				<view class="left">
					<text class="name">武汉敬思亭信息技术有限公司</text>
				</view>
				<view class="right">
					<text class="name">合资 150-500人</text>
				</view>
			</view>
			<view class="fj-b">
				<view class="left">
					<image src="@/static/img/chat/pic.jpg" mode="" class="img"></image>
					<text class="name">向先生</text>·
					<text class="name">人力行政经理</text>
				</view>
				<view class="right">
					<text class="address">武昌区水果湖</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	let showMore = ref(false);
	let searchType = ref(0);
	function switchType(e) {
		searchType.value = e;
	}
</script>

<style scoped lang="scss">
	page {
		background: #F6F6F6;
	}

	.top {
		position: fixed;
		top: calc(44px + env(safe-area-inset-top));
		left: 0;
		width: 100%;
		height: 194rpx;
		background: #FFFFFF;
		padding: 0 22rpx;
		border-bottom: 2rpx solid #E3E3E3;
		z-index: 10;

		.search-box {
			width: 100%;
			height: 80rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			background: #F6F6F6;
			border-radius: 40rpx 40rpx 40rpx 40rpx;

			.city {
				width: 156rpx;
				padding: 0 20rpx 0 30rpx;
				font-size: 32rpx;
				color: #5A5A5A;
				display: flex;
				justify-content: space-between;
				flex-shrink: 1;

				.text {
					width: 100%;
					white-space: nowrap;
					text-overflow: ellipsis;
					overflow: hidden;
				}

				.icon {
					margin-left: 10rpx;
					flex-shrink: 0;
				}
			}

			.input {
				width: 552rpx;
				flex-shrink: 0;
				padding: 0 20rpx;
				border-left: 1rpx solid #D8D8D8;
			}
		}

		.search-bottom {
			height: 110rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.left {
				font-size: 30rpx;
				color: #5A5A5A;

				text {
					margin: 0 15rpx;
				}

				text.active {
					font-weight: 500;
					color: #1C1C1C;
				}
			}

			.right {
				display: flex;
				align-items: center;

				.tag {
					display: flex;
					justify-content: center;
					align-items: center;
					height: 60rpx;
					padding: 0 34rpx 0 20rpx;
					font-size: 30rpx;
					color: #5A5A5A;
					margin-left: 14rpx;
					background: #F6F6F6;
					border-radius: 8rpx;
					position: relative;

					&::after {
						content: '';
						position: absolute;
						right: 16rpx;
						bottom: 16rpx;
						width: 0;
						height: 0;
						border-bottom: 8rpx solid #BCBCBC;
						border-left: 8rpx solid #F6F6F6;
					}
				}

				.tag.active {
					color: #fff;
					background: rgba(144, 188, 255, 0.6);

					&::after {
						border-bottom: 8rpx solid #fff;
						border-left: 8rpx solid transparent;
					}
				}
			}
		}
	}

	.list {
		margin-top: 194rpx;
		margin-bottom: 20rpx;
	}

	.company {
		.company-item {
			width: 100%;
			padding: 0 25rpx 10rpx 25rpx;
			margin-bottom: 26rpx;
			background: #fff;
		}

		.com-info {
			width: 100%;
			height: 180rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1rpx solid #E8E8E8;

			image {
				width: 120rpx;
				height: 120rpx;
			}

			.info-right {
				width: 550rpx;
				height: 100%;
				font-size: 28rpx;
				color: #5A5A5A;
				padding-right: 25rpx;
				display: flex;
				flex-wrap: wrap;
				align-content: center;
				position: relative;

				.name {
					width: 100%;
					font-size: 34rpx;
					color: #1C1C1C;
					margin-bottom: 10rpx;
					font-weight: bold;
				}

				.one-line {
					text {
						white-space: nowrap;
					}
				}

				.after {
					width: 20rpx;
					height: 20rpx;
					position: absolute;
					right: 0;
					top: 50%;
					margin-top: -10rpx;
				}
			}
		}

		.job-info {
			width: 100%;
			padding-top: 10rpx;
			display: flex;
			flex-wrap: wrap;
			align-content: center;

			&:first-child {
				padding-top: 20rpx;
			}

			.title {
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 34rpx;
				color: #1C1C1C;
				font-weight: bold;
				margin-bottom: 20rpx;

				.num {
					font-weight: normal;
					flex-shrink: 0;
					font-size: 36rpx;
					color: #1872FF;
				}
			}

			.p {
				font-size: 28rpx;
				color: #5A5A5A;

				text {
					margin-right: 20rpx;
				}

				text:last-child {
					margin-right: 0;
				}
			}

			.tag {
				display: inline-flex;
				align-items: center;
				vertical-align: middle;
				padding: 0 16rpx;
				height: 50rpx;
				background: #F6F6F6;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				font-size: 24rpx;
				color: #676767;
				margin-right: 14rpx;
				margin-bottom: 10rpx;
			}
		}

		.look-more {
			width: 100%;
			height: 84rpx;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			display: flex;
			font-size: 36rpx;
			color: #676767;
			justify-content: center;
			align-items: center;
			margin: 20rpx 0;
		}
	}

	.job {
		.job-item {
			width: 100%;
			padding: 18rpx 25rpx 14rpx 25rpx;
			margin-bottom: 26rpx;
			background: #fff;

			.title {
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 34rpx;
				color: #1C1C1C;
				font-weight: bold;
				margin-bottom: 10rpx;

				.num {
					font-weight: normal;
					flex-shrink: 0;
					font-size: 36rpx;
					color: #1872FF;
				}
			}

			.p {
				font-size: 28rpx;
				color: #5A5A5A;
				// margin-bottom: 20rpx;

				text {
					margin-right: 20rpx;
				}

				text:last-child {
					margin-right: 0;
				}
			}

			.tag {
				display: inline-flex;
				align-items: center;
				vertical-align: middle;
				padding: 0 16rpx;
				height: 50rpx;
				background: #F6F6F6;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				font-size: 24rpx;
				color: #676767;
				margin-right: 14rpx;
				margin-bottom: 14rpx;
			}

			.img {
				width: 52rpx;
				height: 52rpx;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				margin-right: 18rpx;
				vertical-align: middle;
			}

			.name {
				font-weight: bold;
				font-size: 28rpx;
				color: #111111;
			}

			.fj-b {
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 28rpx;
				color: #111111;
				margin-bottom: 16rpx;

				.address {
					font-size: 28rpx;
					color: #B8B8B8;
				}
			}
		}
	}
</style>